using System;
using System.ComponentModel;
using System.Runtime.Serialization;

namespace WcfService1.DTO
{
    [DataContract]
    public class PurchaseInvoiceDetailDTO : INotifyPropertyChanged
    {
        private Decimal _BiayaForwarder;
        private Decimal _BiayaImport;
        private Decimal _Discount;
        private String _DiscountType;
        private InventoryDTO _Inventory;
        private int _No;
        private Decimal _Price;
        private Int32 _PurchaseInvoiceDetailId;
        private decimal _Qty;
        private Decimal _TotalDetail;
        private WarehouseDTO _Warehouse;

        [DataMember]
        public Int32 PurchaseInvoiceDetailId
        {
            get { return _PurchaseInvoiceDetailId; }
            set
            {
                _PurchaseInvoiceDetailId = value;
                RaisePropertyChanged("PurchaseInvoiceDetailId");
            }
        }


        [DataMember]
        public InventoryDTO Inventory
        {
            get { return _Inventory; }
            set
            {
                _Inventory = value;
                RaisePropertyChanged("Inventory");
            }
        }


        [DataMember]
        public Decimal Qty
        {
            get { return _Qty; }
            set
            {
                _Qty = value;
                RaisePropertyChanged("Qty");
            }
        }


        [DataMember]
        public Decimal Price
        {
            get { return _Price; }
            set
            {
                _Price = value;
                RaisePropertyChanged("Price");
            }
        }


        [DataMember]
        public Decimal Discount
        {
            get { return _Discount; }
            set
            {
                _Discount = value;
                RaisePropertyChanged("Discount");
            }
        }


        [DataMember]
        public String DiscountType
        {
            get { return _DiscountType; }
            set
            {
                _DiscountType = value;
                RaisePropertyChanged("DiscountType");
            }
        }


        [DataMember]
        public Decimal BiayaForwarder
        {
            get { return _BiayaForwarder; }
            set
            {
                _BiayaForwarder = value;
                RaisePropertyChanged("BiayaForwarder");
            }
        }


        [DataMember]
        public Decimal BiayaImport
        {
            get { return _BiayaImport; }
            set
            {
                _BiayaImport = value;
                RaisePropertyChanged("BiayaImport");
            }
        }

         [DataMember]
        public Decimal TotalDetail
        {
            get { return _TotalDetail; }
            set
            {
                _TotalDetail = value;
                RaisePropertyChanged("TotalDetail");
            }
        }

        [DataMember]
        public WarehouseDTO Warehouse
        {
            get { return _Warehouse; }
            set
            {
                _Warehouse = value;
                RaisePropertyChanged("Warehouse");
            }
        }

        public int No
        {
            get { return _No; }
            set
            {
                _No = value;
                RaisePropertyChanged("No");
            }
        }

        #region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion

        protected void RaisePropertyChanged(string propertyname)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null)
                handler(this, new PropertyChangedEventArgs(propertyname));
        }
    }
}